Skip to content

fix(web): support deep strict intersections#3699

Open
chrarnoldus wants to merge 3 commits into
mainfrom
fix/deep-strict-intersections
Open

fix(web): support deep strict intersections#3699
chrarnoldus wants to merge 3 commits into
mainfrom
fix/deep-strict-intersections

Conversation

@chrarnoldus
Copy link
Copy Markdown
Contributor

@chrarnoldus chrarnoldus commented Jun 3, 2026

Summary

  • Extend deepStrict to recurse through Zod intersection wrappers instead of rejecting them as unsupported.
  • Merge object-intersection shapes before strictification so valid combined objects remain accepted while unknown nested keys are rejected.
  • Preserve both validators for overlapping object keys and cover chained object intersections.

Verification

  • Evaluated valid, unknown-key, chained, and overlapping-key intersection inputs through a direct deepStrict runtime check.

Visual Changes

N/A

Reviewer Notes

  • Object-intersection branches are merged before rebuilding a strict object because independently strictifying disjoint object branches would reject each branch's valid sibling keys.
  • The focused Jest suite could not complete in this sandbox because its global setup requires Postgres and Docker is unavailable.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@chrarnoldus chrarnoldus self-assigned this Jun 3, 2026
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Jun 3, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The intersection support in deepStrict is logically correct: object-only intersections are merged into a single flat shape before strictification (correctly handling overlapping keys and chained .and() calls), while mixed or non-object intersections fall back to recursive deep-strictification of each branch.

Files Reviewed (2 files)
  • apps/web/src/lib/zod/deep-strict.ts
  • apps/web/src/lib/zod/deep-strict.test.ts

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 623,999 tokens

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant